<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"      
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:ic="http://ivyteam.ch/jsf/component"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pe="http://primefaces.org/ui/extensions"
      xmlns:pm="http://primefaces.org/mobile">
 
 	<p:dialog id="editViewDialog" widgetVar="editViewDialogVar">
		<f:facet name="header">
			<h:outputLabel value="#{data.selectedTask.id}"/>
		</f:facet>
 		<h:form id="formUpdate">
	 		<p:panelGrid columns="2">
				<h:outputLabel>Title</h:outputLabel>
				<h:outputText value="#{data.selectedTask.title}" />
				
				<h:outputLabel>Description</h:outputLabel>
				<p:inputTextarea id="inputTextareaDescription" value="#{data.selectedTask.description}" style="max-height:150px; overflow-y: auto;"/>
			
				<h:outputLabel>Assignee</h:outputLabel>
				
				<p:autoComplete value="#{data.assigneeUsername}" id="user" 
					completeMethod="#{logic.completeAssignee}" delay="500" required="true"/>
					
				<h:commandButton value="History">
					<p:ajax listener="#{logic.onClickOnHistoryDialog(data.selectedTask)}" 
					update=":#{p:component('historyDialog')}" oncomplete="historyViewDialogVar.show()"/>
				</h:commandButton>
				
				<h:commandButton value="Save" actionListener="#{logic.update}" update=":#{p:component('dashboard')}" />
			</p:panelGrid>
		</h:form> 
 	</p:dialog>
   
</html>